package pojo;

import org.w3c.dom.Document;
import org.w3c.dom.Element;

public class NodeThaoLuanPOJO {
	private int id;
	private int idNguoiTao;
	private int idNodeCha;
	private int idCay;
	private String noiDung;
	private String ghiChu;
	private long version;
	private int tinhTrang;
	public int getId() {
		return id;
	}
	public void setId(int id) {
		this.id = id;
	}
	public int getIdNguoiTao() {
		return idNguoiTao;
	}
	public void setIdNguoiTao(int idNguoiTao) {
		this.idNguoiTao = idNguoiTao;
	}
	public int getIdNodeCha() {
		return idNodeCha;
	}
	public void setIdNodeCha(int idNodeCha) {
		this.idNodeCha = idNodeCha;
	}
	public int getIdCay() {
		return idCay;
	}
	public void setIdCay(int idCay) {
		this.idCay = idCay;
	}
	public String getNoiDung() {
		return noiDung;
	}
	public void setNoiDung(String noiDung) {
		this.noiDung = noiDung;
	}
	public String getGhiChu() {
		return ghiChu;
	}
	public void setGhiChu(String ghiChu) {
		this.ghiChu = ghiChu;
	}
	public long getVersion() {
		return version;
	}
	public void setVersion(long version) {
		this.version = version;
	}
	
	public int getTinhTrang() {
		return tinhTrang;
	}
	public void setTinhTrang(int tinhTrang) {
		this.tinhTrang = tinhTrang;
	}
	public Element createXMLElement(Document doc) {
		Element e = doc.createElement("TreeNode");
		e.setAttribute("ID", this.id + "");
		e.setAttribute("title", this.noiDung);
		e.setAttribute("text", this.ghiChu + "");
		e.setAttribute("x", "0");
		e.setAttribute("y", "0");
		e.setAttribute("user", this.idNguoiTao+"");
		e.setAttribute("version", this.version + "");
		e.setAttribute("label", this.tinhTrang + "");
		e.setAttribute("parentID", this.idNodeCha+"");
		
		return e;
	}
}
